@extends('admin/layout/index')
@section('content')
<div class="mws-panel grid_8 mws-collapsible">
    <div class="mws-panel-header">
        <span><i class="icon-table"></i>{{ $title }}<a href="/admin/version/add/{{ $gid }}" style='margin-left:900px'>新增型号</a></span>
        <div class="mws-collapse-button mws-inset">
            <span></span>
        </div>
    </div>
    <div class="mws-panel-inner-wrap">
        <div class="mws-panel-body no-padding">
            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
                <form action="/admin/version/index/{{ $gid }}" method='get'>
                    <div id="DataTables_Table_0_length" class="dataTables_length">
                    <label>显示
                    <select size="1" name="count" aria-controls="DataTables_Table_0">
                        <option value="10" @if( $var['count'] == 10 ) selected @endif >10</option>
                        <option value="20" @if( $var['count'] == 20 ) selected @endif >20</option>
                        <option value="50" @if( $var['count'] == 50 ) selected @endif >50</option>
                        <option value="100" @if( $var['count'] == 100 ) selected @endif >100</option>
                    </select>条
                     </label>
                    </div>
                    <div class="dataTables_filter" id="DataTables_Table_0_filter">
                        <label><input name='search' type="text" value="{{ old('search') }}" ><input type="submit" value='搜索'></label>
                    </div>
                </form>
                
                <table class="mws-table mws-datatable dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
                <thead>
                <tr role="row">
                    <th>
                        型号名称
                    </th>
                    <th>
                        进货价
                    </th>
                        <th>
                        售货价
                    </th>
                    <th>
                        上架数量
                    </th>
                    <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 126px;" aria-label="">
                        操作
                    </th>
                </tr>
                </thead>
                <tbody role="alert" aria-live="polite" aria-relevant="all">
                @foreach( $data as $k => $v )
                <tr class="odd">
                    <td class=" sorting_1">
                       {{ $v['title'] }}
                    </td>

                    <td class=" sorting_1">
                       {{ $v['orig'] }}
                    </td>
                    <td class=" ">
                        {{ $v['price'] }}
                    </td>
                    <td class=" ">
                        {{ $v['num'] }}
                    </td>
                    
                    <td class=" ">
                        <span class="btn-group">
                        <a href="/admin/version/edit/{{ $gid }}?id={{ $v['id'] }}" class="btn btn-small" title='编辑当前型号'><i class="icon-pencil"></i></a>
                        <a href="/admin/version/down/{{ $gid }}?id={{ $v['id'] }}" class="btn btn-small" title='删除当前型号'><i class="icon-trash"></i></a>
                        <a href="/admin/image/index/?gid={{ $gid }}&ve_id={{ $v['id'] }}" class="btn btn-small" title='查看商品图片'><i class="icon-plus"></i></a>
                        </span>
                    </td>
                </tr>
                 @endforeach
                 </tbody>
                </table>
                <!-- 显示分页 -->
                {!! $data->appends($var)->render() !!}
            </div>
        </div>
    </div>
</div>
@endsection
